package Models

import (
	"github.com/jinzhu/gorm"
	"time"
)

type UserLoginLog struct {
	Id        int       `gorm:"column:id"`
	UserId    int       `gorm:"column:user_id"`
	LoginTime time.Time `gorm:"column:login_time"`
}

// 设置Test的表名为`test`
func (UserLoginLog) TableName() string {
   return "user_login_log"
}

func (this *UserLoginLog) Insert(tx *gorm.DB) (id int, err error) {
	result := tx.Create(&this)
	id = this.Id
	if result.Error != nil {
		err = result.Error
		return
	}
	return
}